let baseURL;
const NODE_ENV = process.env.NODE_ENV;
console.log(NODE_ENV,"NODE_ENV")

if (NODE_ENV === "development") {
	// baseURL = '/api';
	// baseURL = 'http://47.99.33.32:20001/app-admin'
	// baseURL = 'http://192.168.3.24:9008/app-admin'
	// baseURL = "http://localhost:9008/app-admin";
	// baseURL = "https://api.mjerp123.com/app-admin";
	baseURL = "https://dev.admin.mjerp123.com/app-admin"
} else{
	// baseURL = 'http://47.99.33.32:20001/app-admin'
	baseURL = "https://api.mjerp123.com/app-admin";
	// baseURL = "https://dev.admin.mjerp123.com/app-admin"
}
//http://api.mjerp123.com:20001/app-admin/#/home

/**
 * 马上登录事件
 * */
async function toLogin() {
	await uni.$u.sleep(300)
	let pages = getCurrentPages();
	let forward = pages && pages[pages.length - 1] ? pages[pages.length - 1]['$page'] : null;
	uni.setStorageSync('forward', JSON.stringify(forward));
	uni.$u.route({
		type: 'redirectTo',
		url: '/pages/login/index'
	});
}

export default {
	baseURL,
	toLogin
};
